package com.wxy.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wxy.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author 47868
 */
@Mapper
@Component("UserMapper")
public interface UserMapper extends BaseMapper<User> {
    @Select("select * from user")
    public List<User> findAll();

    @Select("select * from user where id=#{id}")
    public User findById(int id);

    @Update("update user set password=#{password} where id=#{id}")
    public int updatePasswordById(@Param("id") int id, @Param("password") String password);
}
